package com.wxq.auth.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * @author Jim
 * @date 8:37 下午 2022/4/10
 * @description 用户注册
 * @email:huwmz04153277@126.com
 */
@Data
public class UserRegisterVO {
    @Length(min = 2, max = 16, message = "用户名必须是2-16位字符")
    @NotEmpty(message = "用户名不能为空")
    private String username;

    @Length(min = 6, max = 20, message = "密码必须是6-20位字符")
    @NotEmpty(message = "密码不能为空")
    private String password;

    @Pattern(regexp = "^[1](([3][0-9])|([4][0,1,4-9])|([5][0-3,5-9])|([6][2,5,6,7])|([7][0-8])|([8][0-9])|([9][0-3,5-9]))[0-9]{8}$",
            message = "手机号格式不正确")
    @NotEmpty(message = "手机号不能为空")
    private String mobile;

    @NotEmpty(message = "验证码不能为空")
    private String code;
}
